module.exports = (app) => {
  const { INTEGER, STRING, DATE, BOOLEAN } = app.Sequelize
  const Tags = app.model.define('tags', {
    id: {
      type: INTEGER(20).UNSIGNED,
      allowNull: false,
      autoIncrement: true,
      primaryKey: true,
      comment: '主键id'
    },
    tag: {
      type: STRING(20),
      allowNull: false,
      comment: '标签名称'
    },
    status: {
      type: BOOLEAN,
      allowNull: false,
      defaultValue: 1,
      comment: '状态 1:正常 0:删除'
    },
    type: {
      type: STRING(20),
      allowNull: false,
      range: ['works', 'photo'],
      comment: '标签类型'
    },
    created_at: DATE,
    updated_at: DATE
  })
  return Tags
}
